package com.oop7.OldDriver;

public class OldDriver {// 老司机类

	private String name;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public OldDriver(String name) {
		super();
		setName(name);
	}

	public void drive(Car c) {
		System.out.println(this.name + "开着汽车，座位" + c.getSeatNum() + ",排量" + c.getDisplacement());
	}

	public void drive(Plane p) {
		System.out.println(this.name + "开着飞机，座位" + p.getSeat() + ",飞行高度" + p.getFlightAltitude());
	}

	public void drive(Tank t) {
		System.out.println(this.name + "开着坦克，携带弹头" + t.getNumber() + ",马力数" + t.getPower());
	}

	public void drive(Tractor tr) {
		System.out.println(this.name + "开着拖拉机，载重" + tr.getWeight() + ",体积" + tr.getVolume());
	}

	public void drive(Ship s) {
		System.out.println(this.name + "开着轮船，载重" + s.getWeight() + ",排水量" + s.getDisplacement() + ",航速" + s.getSpeed());
	}

}
